[New] async-server-action: Add rule to require that server actions be async#3729
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3729 +/- ##
==========================================
+ Coverage 94.47% 97.59% +3.11%
==========================================
Files 134 134
Lines 9613 9479 -134
Branches 3486 3468 -18
==========================================
+ Hits 9082 9251 +169
+ Misses 531 228 -303 ☔ View full report in Codecov by Sentry. |
ljharb
left a comment
There was a problem hiding this comment.
I see some examples using single and double quotes - great! - but none using backticks. Can we add some? (whether it's supported or not)
I knew I'd miss a few things 😅 Thanks for the feedback, really appreciate it! Backticks don't work with use server, but great idea to test them. Adding now. |
|
A semi-related question that came to mind that I'd like advice on: Other ESLint rules like |
|
The As such, the solution there is to just disable those horrifically foolish rules. |
9d050e8 to
4d1e087
Compare
ljharb
left a comment
There was a problem hiding this comment.
Rebased. I'd love to see lots more test cases, and I'm not going to merge this until the feature is available in a non-canary full release, so I'll mark it as a draft until then.
380e32c to
51d342b
Compare
Makes sense to me! When the full release rolls around we can spruce up the test cases and get this merged :) |
|
Hi! React 19 launched as stable today. Are we still interested in getting this merged? If so we can fix merge conflicts and spruce up tests to do so! |
|
@jorgezreik yep, let's do those things :-) mark it as ready for review when you think it's so |
4d1e087 to
d6cabac
Compare
624c940 to
5d4bf12
Compare
Adds a new rule to require that a server actions (functions with the
'use server'directive) be async as specified by the server actions spec. Suggests fixes for server actions that aren't async by adding the async keyword.